package com.why.blog.service.iml;

import com.why.blog.bean.Type;
import com.why.blog.dao.typeDao;
import com.why.blog.service.typeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: blog
 * @description:
 * @author: @why
 * @create: 2021-01-16 12:00
 **/
@Service
public class typeServiceIml implements typeService {

    @Resource
    private typeDao  type;
    @Override
    public List<Type> getListType() {
        return type.getListType();
    }

    @Override
    public Type getTypeById(Integer id) {
        return type.getTypeById(id);
    }

    @Transactional
    @Override
    public int deleteTypeById(Integer id) {
        return type.deleteTypeById(id);
    }

    @Override
    public int updateType(Type type) {
        return this.type.updateType(type);
    }

    @Transactional
    @Override
    public void saveType(Type type) {
        this.type.saveType(type);

    }

    @Override
    public int typeNums() {
        return  type.typeNums();
    }

    @Override
    public Integer getTypeByName(String name) {
        return this.type.getTypeByName(name);
    }

    @Override
    public List<Type> getListBlogByType() {
        return type.getListBlogByType();
    }
}
